package util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import core.FileList;

public class IO {

	public static FileList ReadFile(String pathFile){
		String string = "";;
		
		try {
			InputStream ips = new FileInputStream(pathFile);
			InputStreamReader ipsr = new InputStreamReader(ips);
			BufferedReader br = new BufferedReader(ipsr);
			String line = "";

			line = br.readLine();
			String[] t = line.split(" ");
			line = br.readLine();
			String[] d = line.split(" ");
			line = br.readLine();
			String[] s = line.split(" ");
			
			br.close();
			
			FileList fl = new FileList();
			
			fl.setTeachers(t);
			fl.setSemesters(s);
			fl.setDates(d);
			
			return fl;

		} catch (Exception e) {
			System.out.println("Erro: " + e.toString());
		}
		return null;
	}
		
}
